package cn.le.aopAnnotationDataSource.jdbc;

import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;

/**
 * Created by admin on 2017/3/28.
 * 动态设置数据源
 */
public class DynamicDataSource extends AbstractRoutingDataSource {
    @Override
    protected Object determineCurrentLookupKey() {
        //获取当前数据源
        return JdbcContextHolder.getJdbcType();
    }
}
